# 定义基类
from typing import TypedDict, Annotated, Sequence


class BaseDebateAgent:
    """辩论智能体抽象基类"""

    def __init__(self, llm):
        self.llm = llm

    def invoke(self, side: str, topic: str, stage: str, role: str,role_prompt: str, task: str, history: list = None) -> str:
        raise NotImplementedError


class DebateState(TypedDict):
    """辩论状态"""
    side: str  # 辩论方
    topic: str  # 辩论题目
    stage: str  # 辩论阶段
    role: str   # 角色
    role_prompt: str  # 角色提示
    task: str   # 任务
    history: Annotated[Sequence[str], lambda a, b: a + b]   # 历史对话
    llm_thought: str  # LLM的思考
    speech: str  # 发言

